<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>Blog</title>
  <link rel="stylesheet" href="/stylesheets/style.css">
</head>
<body>
<header>
    <h1><%= title %></h1>
</header>

<nav>
    <span><a href="/">首页</a></span>
    <span><a href="/archive">存档</a></span>
    <span><a href="/tags">标签</a></span>
    <% if (user) { %>
    <span><a href="/upload">上传</a></span>
    <span><a href="/post">发布</a></span>
    <span><a href="/logout">退出</a></span>
    <% } else { %>
    <span><a title="登录" href="/login">登录</a></span>
    <span><a title="注册" href="/reg">注册</a></span>
    <% } %>
    <span><form action="/search" method="GET"><input type="text" name="keyword" placeholder="SEARCH" class="search" /></form></span>
</nav>
<article>
    <% if (success) { %>
    <div><%= success %></div>
    <% } %>
    <% if (error) { %>
    <div><%= error %> </div>
    <% } %>